import FetchMock from "fetch-mock";
import regionData from "./data/region-data";

FetchMock.mock("/login", (url, opts) =>{
   const params = opts.params;
   if (params.account === "18512345678"){
       if (params.password === "123456"){
           return {code: 200, message: "success"}
       }
       else {
           return {code: 401, message: "密码错误"}
       }
   }
   else {
       return {code: 400, message: "用户名错误"}
   }
});

FetchMock.mock("/getMobileVerifyToken", (url, opts) =>{
    return {code: 200, message: "success", mobileVerifyToken: "123456"};
});

FetchMock.mock("/register/getVerifyCode",(url, opts) =>{
    const params = opts.params;
    return {code: 200, message: "success", mobile : params.mobile};
});
FetchMock.mock("/register/mobile", {code: 200, message: "success"});


FetchMock.mock("/region-data", {code: 200, message: "success", data : regionData});

FetchMock.mock("/register/info", {code: 200, message: "success"});

FetchMock.mock("/register/payment", {code: 200, message: "success"});